

import 'bind_point.dart';

class DeviceStatusResult {
  int? currentPage;
  int? pageSize;
  int? totalNum;
  int? isMore;
  int? totalPage;
  int? startIndex;
  List<DeviceDetailModel>? items;

  DeviceStatusResult({this.currentPage,
    this.pageSize,
    this.totalNum,
    this.isMore,
    this.totalPage,
    this.startIndex,
    this.items});

  DeviceStatusResult.fromJson(Map<String, dynamic> json) {
    currentPage = json['currentPage'];
    pageSize = json['pageSize'];
    totalNum = json['totalNum'];
    isMore = json['isMore'];
    totalPage = json['totalPage'];
    startIndex = json['startIndex'];
    if (json['items'] != null) {
      items = <DeviceDetailModel>[];
      json['items'].forEach((v) {
        items!.add(new DeviceDetailModel.fromJson(v));
      });
    }
  }
}

class DeviceDetailModel {
  int? id;
  String? macAddr;
  int? type;
  String? typeStr;
  double? coverRatio;
  StatusInfo? statusInfo;
  List<RecordList>? recordList;
  BindPointModel? bindPoint;

  DeviceDetailModel({this.id,
    this.macAddr,
    this.type,
    this.typeStr,
    this.coverRatio,
    this.statusInfo,
    this.recordList,
    this.bindPoint});

  DeviceDetailModel.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    macAddr = json['macAddr'];
    type = json['type'];
    typeStr = json['typeStr'];
    coverRatio = json['coverRatio'];
    statusInfo = json['statusInfo'] != null
        ? new StatusInfo.fromJson(json['statusInfo'])
        : null;
    if (json['recordList'] != null) {
      recordList = <RecordList>[];
      json['recordList'].forEach((v) {
        recordList!.add(new RecordList.fromJson(v));
      });
    }
    bindPoint = json['bindPoint'] != null
        ? new BindPointModel.fromJson(json['bindPoint'])
        : null;
  }
}

class StatusInfo {
  int? id;
  int? deviceId;
  int? deviceStatus;
  String? deviceStatusStr;
  String? heartbeatTime;
  String? sendDataTime;

  StatusInfo(
      {this.id,
        this.deviceId,
        this.deviceStatus,
        this.deviceStatusStr,
        this.heartbeatTime,
        this.sendDataTime});

  StatusInfo.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    deviceId = json['deviceId'];
    deviceStatus = json['deviceStatus'];
    deviceStatusStr = json['deviceStatusStr'];
    heartbeatTime = json['heartbeatTime'];
    sendDataTime = json['sendDataTime'];
  }

}

class RecordList {
  int? id;
  int? deviceId;
  int? dataType;
  String? dataTypeStr;
  String? data;
  Null? createTime;
  Null? deviceInfo;

  RecordList(
      {this.id,
        this.deviceId,
        this.dataType,
        this.dataTypeStr,
        this.data,
        this.createTime,
        this.deviceInfo});

  RecordList.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    deviceId = json['deviceId'];
    dataType = json['dataType'];
    dataTypeStr = json['dataTypeStr'];
    data = json['data'].toString();
    createTime = json['createTime'];
    deviceInfo = json['deviceInfo'];
  }
}


